package com.j177.could.controller;

import com.j177.cloud.dto.UserDto;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.*;

/**
 * @Author:LuJiaHong
 * @Date:2020/11/30~16:46:44
 * @Version 1.0
 */
@RestController
public class UserController {
    @GetMapping("loginByStr/{userName}/{passWord}")//此种url风格采用restFul（URL定位资源，用HTTP动词（GET,POST,DELETE,PUT）描述操作。）
    public String loginByStr(@PathVariable("userName") String userName,@PathVariable("passWord") String passWord){
        System.out.println("用户名："+userName+",密码："+passWord);
        return "ok,str.toThis"+userName+"/"+passWord;
    }

    @PostMapping("loginByObj")
    public String loginByObj(@RequestBody UserDto userDto){
        System.out.println("用户名："+userDto.getUserName()+",密码："+userDto.getPassWord());
        return "ok,obj.toThis"+userDto;
    }
}
